package com.edais.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import com.edais.domain.PushMessageDetail;
import com.edais.domain.PushMessages;
import com.edais.persistence.PushMapper;

@Repository

public class PushDao {
	@Autowired
	private PushMapper pushMapper;

	public int getMesTotalNum(String userId) throws Exception{
		return pushMapper.getMesTotalNum(userId);
	}
	
	public List<PushMessages> getMessageList(String userId,Integer current,Integer pageSize) throws Exception {
		return pushMapper.getMessageList(userId,current,pageSize);
	}
	
	public PushMessageDetail  getMessageDetail(String messageId) throws Exception {
		return pushMapper.getMessageDetail(messageId);
	}
	
	public String  getPushSeq() throws Exception {
		return pushMapper.getPushSeq();
	}
	
	/**
	 * 查询  推送用户与设备的关系
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public List<Map> getPushUserDeviceByDevice(Map map) throws Exception {
		return pushMapper.getPushUserDeviceByDevice(map);
	}
	
	/**
	 * 查询  推送用户与设备的关系
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public List<Map> getPushUserDeviceByUser(Map map) throws Exception {
		return pushMapper.getPushUserDeviceByUser(map);
	}
	
	/**
	 * 查询  推送用户与设备的关系
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public List<Map> getPushUserDeviceByUserDevice(Map map) throws Exception {
		return pushMapper.getPushUserDeviceByUserDevice(map);
	}
	
	/**
	 * 添加  推送用户与设备的关系
	 * @param map
	 * @throws Exception
	 */
	public void  insertPushUserDevice(Map map) throws Exception {
		pushMapper.insertPushUserDevice(map);
	}
	
	/**
	 * 修改  推送用户与设备的关系
	 * @param map
	 * @throws Exception
	 */
	public void  updatePushUserDevice(Map map) throws Exception {
		pushMapper.updatePushUserDevice(map);
	}
	
	/**
	 * 修改  推送用户与设备的关系
	 * @param map
	 * @throws Exception
	 */
	public void  updatePushUserDeviceOnly(Map map) throws Exception {
		pushMapper.updatePushUserDeviceOnly(map);
	}
	
	/**
	 * 添加  请求消息推送系统API记录
	 * @param map
	 * @throws Exception
	 */
	public void  insertPushAPIRecorde(Map map) throws Exception {
		pushMapper.insertPushAPIRecorde(map);
	}
}
